package com.hc.service.impl;

import com.hc.bean.Type;
import com.hc.dao.TypeDao;
import com.hc.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TypeServiceImpl implements TypeService {
    @Autowired
    private TypeDao typeDao;
    @Override
    public List<Type> getTypeList() {
        return typeDao.getTypeList();
    }

    @Override
    public Boolean addType(Type type) {
        if(typeDao.addType(type)>0)
            return true;
        return false;
    }

    @Override
    public Boolean updateType(Type type) {
        if(typeDao.updateTye(type)>0)
            return true;
        return false;
    }

    @Override
    public Type getTypeById(Integer tid) {
        return typeDao.getTypeById(tid);
    }
}
